package ar.edu.itba.it.pdc.configuration.models.filters.originFilters;

import java.net.InetAddress;

import ar.edu.itba.it.pdc.configuration.models.Request;

public class OriginIpFilter extends OriginFilter {
	
	private InetAddress ip;
	
	public OriginIpFilter(InetAddress ip) {
		this.ip = ip;
	}

	@Override
	public boolean applyFilter(Request req) {
		return !ip.equals(req.getOriginIp());
	}
	
	@Override
	public String getContent() {
		return ip.toString();
	}
	
	@Override
	public String getCriteria() {
		return "IP";
	}
}
